<template>
	<view class="order-type" :class="translateType(value).class">
		{{translateType(value).desc}}
	</view>
</template>

<script>
	export default {
		name: "orderType",
		data() {
			return {

			};
		},

		props: {
			value: {
				type: Number,
			}
		},


		methods: {

			translateType(value) {
				let orderType = {
					desc: '',
					class: ''
				}
				switch (value) {
					case 0:
						orderType.desc = '帮取'
						orderType.class = 'take'
						break;
					case 1:
						orderType.desc = '帮寄'
						orderType.class = 'ji'
						break;
					case 2:
						orderType.desc = '帮买'
						orderType.class = 'buy'
						break;
					case 3:
						orderType.desc = '万能帮'
						orderType.class = 'every'
						break;

				}
				return orderType

			}
		}
	}

</script>

<style lang="scss">
	.order-type {
		width: 44px;
		height: 22px;
		background: rgb(254, 185, 58);
		border-radius: 4px;
		color: #fff;
		font-size: 12px;
		margin-right: 8px;
		line-height: 22px;
		text-align: center;

		&.ji {
			background: rgb(65, 176, 147);

		}

		&.buy {
			background: rgb(101, 132, 247);

		}

		&.every {
			background: rgb(255, 104, 83);

		}
	}

</style>

